/**
  @file     	DESIGNPATTERN_ComplexFactory.h
  @brief    	1. Define an interface for creating an object, and the package object is created
                2. The work of the specific class of delay to sub-class
  @author  	arvin
  @version 	1.0   2012/12/14
 */

#ifndef CXX_DESIGNPATTERN_COMPLEXFACTORY_H
#define CXX_DESIGNPATTERN_COMPLEXFACTORY_H
#include "Profession.h"

class Profession;

class ComplexFactory
{
public:
	/**
	* Destruction
	*
	* @param VOID
	* @return 
	*/
	virtual ~ComplexFactory() = 0;

	/**
	* Create Profession
	*
	* @param VOID
	* @return Profession* 
	* @note
	*/
	virtual Profession* CreateProfession() = 0;

	/**
	* Operation
	*
	* @param VOID
	* @return PROFESSION_TYPE
	*/
	PROFESSION_TYPE GetComplexFactory();
protected:
	/**
	* Construction
	*
	* @param PROFESSION_TYPE eProfession
	* @return 
	*/
	ComplexFactory(PROFESSION_TYPE eProfession);


	/**
	* Operation
	*
	* @param PROFESSION_TYPE eProfession
	* @return
	*/
	VOID SetComplexFactory(PROFESSION_TYPE eProfession);
private:

	/**
	* Construction
	*
	* @param VOID
	* @return
	*/
	ComplexFactory();

	/**
	* Copy Construction
	*
	* @param const ComplexFactory& cComplexFactory
	* @return 
	*/
	ComplexFactory(const ComplexFactory& cComplexFactory);

	/**
	* Assignment
	*
	* @param const ComplexFactory& cComplexFactory
	* @return ComplexFactory&
	*/
	ComplexFactory& operator=(const ComplexFactory& cComplexFactory);

public:
protected:
private:
	PROFESSION_TYPE m_eProfession;
};


class WarriorFactory : public ComplexFactory
{
public:
	/**
	* Destruction
	*
	* @param VOID
	* @return 
	*/
	virtual ~WarriorFactory();

	/**
	* Instance
	*
	* @param VOID
	* @return ComplexFactory*
	* @note singleton
	*/
	static ComplexFactory* Instance();
	
	/**
	* Destroy
	*
	* @param VOID
	* @return VOID
	* @note singleton
	*/
	static VOID Destroy();

	/**
	* Create Profession
	*
	* @param VOID
	* @return Profession* 
	* @note create Warrior
	*/
	virtual Profession* CreateProfession();
protected:
private:
	/**
	* Construction
	*
	* @param VOID
	* @return 
	*/
	WarriorFactory();

	/**
	* Copy Construction
	*
	* @param const WarriorFactory& cWarriorFactory
	* @return 
	*/
	WarriorFactory(const WarriorFactory& cWarriorFactory);

	/**
	* Assignment
	*
	* @param const WarriorFactory& cWarriorFactory
	* @return WarriorFactory&
	*/
	WarriorFactory& operator=(const WarriorFactory& cWarriorFactory);

public:
protected:
private:
	static WarriorFactory* m_pInstance;
};

class MasterFactory : public ComplexFactory
{
public:
	/**
	* Destruction
	*
	* @param VOID
	* @return 
	*/
	~MasterFactory();

	/**
	* Instance
	*
	* @param VOID
	* @return ComplexFactory*
	* @note singleton
	*/
	static ComplexFactory* Instance();
	
	/**
	* Destroy
	*
	* @param VOID
	* @return VOID
	* @note singleton
	*/
	static VOID Destroy();

	/**
	* Create Profession
	*
	* @param VOID
	* @return Profession* 
	* @note create Master
	*/
	virtual Profession* CreateProfession();
protected:
private:
	/**
	* Construction
	*
	* @param VOID
	* @return 
	*/
	MasterFactory();

	/**
	* Copy Construction
	*
	* @param const MasterFactory& cMasterFactory
	* @return 
	*/
	MasterFactory(const MasterFactory& cMasterFactory);

	/**
	* Assignment
	*
	* @param const MasterFactory& cMasterFactory
	* @return MasterFactory&
	*/
	MasterFactory& operator=(const MasterFactory& cMasterFactory);

public:
protected:
private:
	static MasterFactory* m_pInstance;
};

class PriestFactory : public ComplexFactory
{
public:
	/**
	* Destruction
	*
	* @param VOID
	* @return
	*/
	~PriestFactory();

	/**
	* Instance
	*
	* @param VOID
	* @return ComplexFactory*
	* @note singleton
	*/
	static ComplexFactory* Instance();

	/**
	* Destroy
	*
	* @param VOID
	* @return VOID
	* @note singleton
	*/
	static VOID Destroy();

	/**
	* Create Profession
	*
	* @param VOID
	* @return Profession*
	* @note create Priest
	*/
	virtual Profession* CreateProfession();
protected:
private:
	/**
	* Construction
	*
	* @param VOID
	* @return
	*/
	PriestFactory();

	/**
	* Copy Construction
	*
	* @param const PriestFactory& cPriestFactory
	* @return
	*/
	PriestFactory(const PriestFactory& cPriestFactory);

	/**
	* Assignment
	*
	* @param const PriestFactory& cPriestFactory
	* @return PriestFactory&
	*/
	PriestFactory& operator=(const PriestFactory& cPriestFactory);

public:
protected:
private:
	static PriestFactory* m_pInstance;
};
#endif	/* >>CXX_DESIGNPATTERN_COMPLEXFACTORY_H<< */
/* EOF */